<template name="uploadformsubtitles">
    {{#if tempSubtitles}}
        <table class="ui celled table">
            <thead>
                <th>Language</th>
                <th>IPFS Hash</th>
            </thead>
            <tbody>
                {{#each tempSubtitles}}
                    <tr>
                        <td>
                            {{lang}}
                            <i class="remove circle icon removeSubtitle" data-lang='{{lang}}' style='cursor: pointer;'></i>
                        </td>
                        <td>{{hash}}</td>
                    </tr>
                {{/each}}
            </tbody>
        </table>
    {{/if}}
    <form class="ui form uploadformsubtitles">
        <div class="two fields">
            <div class="field">
                <div class="ui search">
                    <div class="ui icon input">
                        <input id="subtitleLanguage" class="prompt" type="text" placeholder="{{ translate 'UPLOAD_SUBTITLE_LANGUAGE'}}">
                        <i class="search icon"></i>
                    </div>
                    <div class="results"></div>
                </div>
            </div>
            <div class="field">
                <button id="createSubtitle" class="ui black right labeled dtube icon button" type="button" style="float:right; margin-bottom:10px;">
                    <div style="display:inline-block;padding: 0.8em 1em;">
                        {{ translate 'UPLOAD_CREATE_SUBTITLE'}}
                    </div>
                    <i class="add square icon black" style="background: white;opacity: 1;"></i>
                </button>
            </div>
        </div>
        {{#if isAddingSubtitle}}
            <div style="float: right">{{ isAddingSubtitle }}</div>        
            <label for="importSubtitleFile" style="width: 100%;">
                <a class='ui black dtube icon right labeled button' id='importSubtitle' style='float:left;'> 
                    <div style="display:inline-block;padding: 0.8em 1em;">
                    {{ translate 'UPLOAD_IMPORT_SUBTITLE'}}
                    </div>
                    <i class="file text outline icon black" style="background: white;opacity: 1;"></i>
                </a>
            </label>
            <input type="file" id="importSubtitleFile" style='display: none'>

            <textarea id='subtitleText' rows="10" name='subtitle'></textarea>
            <button id='uploadSubtitle' class="ui red right labeled dtube icon button" type="button" style="float:left; margin-bottom:10px;">
                <div style="display:inline-block;padding: 0.8em 1em;">
                    {{ translate 'UPLOAD_UPLOAD_SUBTITLE'}}
                </div>
                <i class="cloud upload icon red" style="background: white;opacity: 1;"></i>
            </button>
        {{/if}}
    </form>
</template>